#include "abstracteditor.h"
#include "../application.h"
#include "../mainwindow.h"
#include <QStackedWidget>

AbstractEditor::AbstractEditor(QObject *parent) :
    QObject(parent)
  , m_nIndexInStack(-1)
{
}

AbstractEditor::~AbstractEditor()
{
    if(m_view)
    {
        m_view->deleteLater();
    }
}

void AbstractEditor::activate()
{
    QPointer<QStackedWidget> sw = Application::app().mainWindow()->editorsStackedWidget();
    sw->setCurrentIndex(m_nIndexInStack);
}

void AbstractEditor::deactivate()
{

}
